/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package it.polimi.wcalendar.business.security.boundary;

import it.polimi.wcalendar.business.security.entity.Event;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author baldo
 */
public class PeopleInvitedManager {
    EntityManagerFactory emf = Persistence.createEntityManagerFactory("authPU");
        @PersistenceContext
        EntityManager em = emf.createEntityManager();
        
        
        public List GetByEvent(Event event){
             Query createNamedQuery = em.createNamedQuery("PeopleInvited.findByIde");
             createNamedQuery.setParameter("ide", event.getIde());
            List list = createNamedQuery.getResultList();
            return list;
            
        }
}
